//
//  IMTool.m
//  IMChezhil
//
//  Created by zhangliucheng on 15/7/8.
//  Copyright (c) 2015年 CheZhil. All rights reserved.
//

#import "IMTool.h"

@implementation IMTool

+ (NSString *)productMessageId {
    UInt64 recordTime = [[NSDate date] timeIntervalSince1970]*1000;
    return [NSString stringWithFormat:@"%llu", recordTime];
}

+ (NSData *)sendDataWithCode:(NSInteger)code content:(NSString *)content {
    NSData *contentData = [content dataUsingEncoding:NSUTF8StringEncoding];
    NSInteger len = contentData.length + 4;
    
    NSMutableData *data = [NSMutableData new];
    [data appendData:[NSData dataWithBytes:&len length:2]];
    [data appendData:[NSData dataWithBytes:&code length:2]];
    [data appendData:contentData];
    return data;
}

+ (void)uploadImage:(IMImageMessage *)imageMessage {
    
}

+ (void)uploadAudio:(IMAudioMessage *)audioMessage {
    
}

@end
